package com.sh.util;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;

/**
 * @Auther: sh
 * @Version 1.0
 * @Description: 文件工具类
 */
public class FileUtil {

    public static String readFile(String filePath) {
        StringBuilder builder = new StringBuilder();
        try {
            FileReader fileReader = new FileReader(filePath);
            BufferedReader bufferedReader = new BufferedReader(fileReader);
            String line ;
            while ( (line = bufferedReader.readLine()) !=null  ){
                builder.append(line);
            }
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return builder.toString();
    }

}

